package pers.vic.test;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

import pers.vic.boot.base.model.BaseResponse;

@SpringBootApplication
@Controller
public class BootWebTestApplication {
	
	

	public static void main(String[] args) {
		try {
			SpringApplication.run(BootWebTestApplication.class, args);
			
		}catch (Exception e) {
			e.printStackTrace();
		}
	}

	@GetMapping({ "", "/" })
	public String index() {
		return "index";
	}
	
	@GetMapping({ "some","captcha" })
	@ResponseBody
	public String some() {
		return "some";
	}
	
	@GetMapping(value = "/test/{name}", name="test" )
	@ResponseBody
	public BaseResponse test1(@PathVariable String name) {
		return BaseResponse.success(name);
	}
	@GetMapping(value = "/test2/{name}", name="test2" )
	@ResponseBody
	public BaseResponse test2(@PathVariable String name) {
		return BaseResponse.success(name);
	}

}
